package gui;

import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.MouseEvent;
import javax.swing.JButton;

import sfx.SoundManager;



public class GUIWindowMenuOptions extends GUIWindowMenuMain
{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private JButton sound = new JButton("Sound : " + "On");
	private JButton home = new JButton("Home");
	
	public GUIWindowMenuOptions()
	{
		super();
		menu.removeAll();
		buttonProperties(sound);
		buttonProperties(home);
		
		menu.setLayout(new GridLayout(3,1,20,20));
		menu.add(sound);
		menu.add(home);
	}
	
	public void mouseClicked(MouseEvent e)
	{
		if(e.getSource() == this.sound)
		{
			
			if(SoundManager.soundState)
			{
				SoundManager.setSoundState(false, "Intro");
				this.sound.setText("Sound : "+"Off");

			}
			else
			{
				SoundManager.setSoundState(true, "Intro");
				this.sound.setText("Sound : "+"On");
			}
		}
		else if(e.getSource() == home) 
		{
			this.dispose();
			GUIWindowMenuMain mainMenu = new GUIWindowMenuMain();
			mainMenu.setVisible(true);
		}
	}

	public void mouseEntered(MouseEvent e)
	{
		if(e.getSource()==this.sound)
		buttonOnMouseEntered(sound);
		
		if(e.getSource()==this.home)
		buttonOnMouseEntered(home);
	}

	public void mouseExited(MouseEvent e)
	{
		if(e.getSource()==this.sound)
		this.sound.setBackground(Color.white);

		if(e.getSource()==this.home)
		this.home.setBackground(Color.white);
	}

	public void mousePressed(MouseEvent e){}
	public void mouseReleased(MouseEvent e){}
}